package board;

import java.awt.Point;

import board.grid.Space;
/** A basic class used to convert between points
 *  and spaces.  
 * 
 * @author R.Wisniewski1101
 *
 */
public interface PointSpaceTranslator {
	/** Convert a point coordinate (in pixels)
	 *  into a space coordinate for this grid.  
	 * 
	 * @param p - the point to convert
	 * @return - the space that contains that point (null is it is in the padding)
	 */
	public Space pointToSpace(Point p);
	/** Convert a space coordinate from the
	 *  grid into the point (in pixels) where
	 *  the space should be rendered.  This
	 *  point represents the top left corner
	 *  of the space.  
	 * 
	 * @param s - the space to convert
	 * @return - the point corresponding to the top left corner of the space (null if space is not valid)
	 */
	public Point spaceToPoint(Space s);
	/** Convert a space coordinate from the
	 *  grid into the point (in pixels) where
	 *  the space should be rendered.  This
	 *  point represents the top left corner
	 *  of the space.  
	 *  <br/><br/>
	 *  This also shifts the space by a given
	 *  percent of the cell size.  The percent
	 *  shift can be any number, even negative
	 *  to allow for shifts up/down and left/right.  
	 *  Shifts can also be greater than 1 to correspond
	 *  to a shift of multiple cell widths.  
	 * 
	 * @param s - the space to convert
	 * @param x_shift - the fraction of a cell width to shift horizontally
	 * @param y_shift - the fraction of a cell width to shift vertically 
	 * @return - the corresponding point
	 */
	public Point spaceToPoint_withOffsets(Space s, double offset_x, double offset_y);
	/** Get the current size of a cell on the
	 *  the grid in pixels.  This represents
	 *  both the width and the height.  
	 * 
	 * @return - the current size of a cell in pixels.  
	 */
	public int getCurrentCellSize();
}
